import React from 'react';
import BubbleChartOutlined from '@material-ui/icons/BubbleChartOutlined';
import { NavView, get_mod, NavListSub, loc } from 'sui';
import { NoPairView } from './nopair/view';
import { SingleView } from './single';
import { GatherView } from './gather';
import { WorkView } from './work';
import { GrindView } from './grind';

const model = (cfg) => {
    const fix = [
        {uid: "census.gather", view: GatherView, value: loc("l_804")},
        {uid: "census.single", view: SingleView, value: loc("l_798")},
        {uid: "census.nopair", view: NoPairView, value: loc("l_782")},
        {uid: "census.work", view: WorkView, value: loc("l_837")},
        {uid: "census.grind", view: GrindView, value: loc("l_151")},
    ];

    return get_mod(cfg, fix, "census");
};

const CenSus = ({ mod, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} name="census"/>;

const NavCenSus = (props) => <NavListSub icon={<BubbleChartOutlined/>} sub={model(props.cfg)} {...props}/>;

export {NavCenSus, CenSus};
